package com.lagou.springboot_work.controller;

import com.lagou.springboot_work.pojo.Article;
import com.lagou.springboot_work.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller
@RequestMapping(value = "/art/")
public class ArtController {

    @Autowired
    private ArticleService articleService;

    @RequestMapping(value = "findArticle")
    public String findArticle(Integer pageNum, Integer pageSize, Model model){
        Page<Article> article = articleService.findArticle(pageNum, pageSize);
        model.addAttribute("model", article);
        return "client/index";
    }


}


